package com.my.test.design.singleinstance;

public class Test {

    public static void main(String[] args) {

        // 饿汉式
        SingleInstance1 s1 = SingleInstance1.getInstnce();

        // 懒汉式->双重锁
        SingleInstance2 s2 = SingleInstance2.getInstnce3();

        // 内部类
        SingleInstance3 s3 = SingleInstance3.getInstance();

        // 枚举
        SingleInstance4 s4 = SingleInstance4.INSTANCE;
    }
}
